<?php
	// we want to be sure that this page is send UTF-8 encoded
	// regardless of apache configration
	header("Content-Type: text/html; charset=utf-8");

	// get the configuration
	include_once("conf.php");

	// get the example/source code file
	$src = empty($_REQUEST['src']) ? "" : $_REQUEST['src'];
	$srcFile = dirname(__FILE__) . "/examples/" . basename($src);
	// highlight the code, this var is empty when no source file is specified
	$sourceCode = empty($_REQUEST['src']) ? "" : highlight_file($srcFile,true);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Mapsolute - php/SOAP examples</title>
	<link rel="stylesheet" href="css/map24.css" type="text/css" />
</head>

<body>
<?php if ( !empty($sourceCode) ): ?>
<div class="execute">
&raquo; <a href="code_execute.php?sid=<?=$CONF['SESSION_ID']?>&src=<?=$_REQUEST['src']?>">Execute this Code</a>
</div>
<?php endif; ?>

<? print($sourceCode); ?>

</body>
</html>